extends TileMapLayer



func _process(delta: float) -> void:
	#从全局变量里面拿，看看当前加了哪些导航层，和非导航层
	if Global.add_nav_spot != null:
		for spots in Global.add_nav_spot:
			erase_cell(Vector2(spots.x,spots.y))
			erase_cell(Vector2(spots.x+1,spots.y))
			erase_cell(Vector2(spots.x,spots.y+1))
			erase_cell(Vector2(spots.x+1,spots.y+1))
			
			# 0 指代的是图块id，0我们设置的了是导航层
			set_cell(Vector2(spots.x,spots.y),0,Vector2i(0,0))
			set_cell(Vector2(spots.x+1,spots.y),0,Vector2i(0,0))
			set_cell(Vector2(spots.x,spots.y+1),0,Vector2i(0,0))
			set_cell(Vector2(spots.x+1,spots.y+1),0,Vector2i(0,0))
		Global.add_nav_spot.clear()
		
		if Global.add_to_no_nav_spot != null:
			for spots in Global.add_to_no_nav_spot:
				erase_cell(Vector2(spots.x,spots.y))
				erase_cell(Vector2(spots.x+1,spots.y))
				erase_cell(Vector2(spots.x,spots.y+1))
				erase_cell(Vector2(spots.x+1,spots.y+1))
				
				# 0 指代的是图块id，0我们设置的了是导航层
				set_cell(Vector2(spots.x,spots.y),1,Vector2i(0,0))
				set_cell(Vector2(spots.x+1,spots.y),1,Vector2i(0,0))
				set_cell(Vector2(spots.x,spots.y+1),1,Vector2i(0,0))
				set_cell(Vector2(spots.x+1,spots.y+1),1,Vector2i(0,0))
			Global.add_to_no_nav_spot.clear()
